#include "g_gpio.h"
#include "gkt_gpio.h"

void gkt_gpio_padmux_config(const gkt_gpio_padmux_desc_s *c_desc)
{
	uint32_t port_id, pin_id;

	if (c_desc) {
		port_id = (uint32_t)(c_desc->pin >> 4);
		pin_id = (uint32_t)(c_desc->pin & 0x0f);
		if ((port_id <= GKT_GPIO_PORTE) && (pin_id < 16))
			MGPIO->CTRL.reg[(port_id * 16) + pin_id] = c_desc->func;
	}
}

